import { categoryListApi, addCategoryListApi } from "@/api/product.js"
export default {
    state: {
        categoryListDatas: {},
        addCategoryListDatas: []
    },
    mutations: {
        changeCategoryListDatas(state, data) {
            state.categoryListDatas = data
        },
        changeAddCategoryListDatas(state, data) {
            state.addCategoryListDatas = data
        }
    },
    actions: {
        async  actChangeCategoryListDatas(context, data) {
            let result = await categoryListApi(data)
            context.commit("changeCategoryListDatas", result.data)
        },
        async  actChangeAddCategoryListDatas(context, data) {
            let result = await addCategoryListApi(data)
            console.log(result.data.data);

            context.commit("changeAddCategoryListDatas", result.data.data)
        }
    }
}